1 00:00:00,360 --> 00:00:02,190 Let's turn off our game. 2 00:00:02,890 --> 00:00:05,730 And then I'm going to close this window here, so I have more room. 3 00:00:05,740 --> 00:00:11,080 I'm going to go back to my game window on the screen Gooey. 4 00:00:11,080 --> 00:00:15,250 I'm going to hit the plus sign and add a text label. 5 00:00:15,760 --> 00:00:16,540 The text label. 6 00:00:16,540 --> 00:00:22,120 I'm going to call this info message info, MSG label. 7 00:00:22,840 --> 00:00:23,380 All right. 8 00:00:23,380 --> 00:00:28,900 I'm going to go to anchor point on my info message label. 9 00:00:28,900 --> 00:00:33,940 Make that 0.5 and 0.5 kind of moves up the label a little bit. 10 00:00:34,270 --> 00:00:35,830 We'll go to position. 11 00:00:35,830 --> 00:00:46,750 I'll make this point five scale on the x zero pixel offset point five scale on the Y, zero pixel offset. 12 00:00:47,500 --> 00:00:48,370 There we go. 13 00:00:48,550 --> 00:01:01,180 And for size, let's try maybe 20% of the screen on the x zero pixel offset 20% on the Y zero pixel 14 00:01:01,180 --> 00:01:01,540 offset. 15 00:01:01,540 --> 00:01:05,260 So 0.2 comma zero comma 0.20. 16 00:01:05,500 --> 00:01:06,640 That's not bad. 17 00:01:07,220 --> 00:01:08,800 Go down and change. 18 00:01:08,800 --> 00:01:10,210 I'm not going to change a lot of stuff. 19 00:01:10,210 --> 00:01:12,460 You could decorate this as much as you want. 20 00:01:12,640 --> 00:01:16,720 Maybe go to sand Sand Source pro the font font face. 21 00:01:17,550 --> 00:01:19,590 Let's get our comic font. 22 00:01:20,910 --> 00:01:22,170 And that's pretty small. 23 00:01:22,170 --> 00:01:24,480 So maybe tech scaled. 24 00:01:25,310 --> 00:01:28,670 Cool and then maybe change the tax color. 25 00:01:29,740 --> 00:01:33,930 Like green or something bright, colorful, hard to see. 26 00:01:33,940 --> 00:01:39,610 So we get our text stroke transparency that'll put a little outline around it, read our text, make 27 00:01:39,610 --> 00:01:40,480 that zero. 28 00:01:40,480 --> 00:01:43,780 The default color for that is black, which I usually keep. 29 00:01:44,020 --> 00:01:51,490 And let's get rid of the background color or the background itself on our info gooey. 30 00:01:52,380 --> 00:01:54,570 Go all the way up to the top. 31 00:01:54,870 --> 00:01:55,710 Background. 32 00:01:55,710 --> 00:01:57,120 Transparency. 33 00:01:57,870 --> 00:01:59,460 Set that to one. 34 00:02:00,780 --> 00:02:01,140 All right. 35 00:02:01,140 --> 00:02:06,960 So we have a relatively simple guy here that we're going to call. 36 00:02:07,260 --> 00:02:08,550 I'm going to grab this thing. 37 00:02:08,550 --> 00:02:12,960 I'm going to drag it on up to replicated storage. 38 00:02:14,420 --> 00:02:19,670 We are going to create one of those little message guys every time we process a message. 39 00:02:19,670 --> 00:02:25,550 So my process message script is right here it is under the screen guy if you lost it. 40 00:02:26,000 --> 00:02:29,360 All right, so up here we got our replicated storage. 41 00:02:29,360 --> 00:02:32,240 This is where we're keeping our UI stuff. 42 00:02:32,240 --> 00:02:33,950 Let's do a local. 43 00:02:33,950 --> 00:02:35,630 And what do we call that info? 44 00:02:35,630 --> 00:02:37,970 Message Label info. 45 00:02:38,330 --> 00:02:44,630 I think I'll just call this label, right, because I don't want it to close to my remote event and 46 00:02:45,080 --> 00:02:47,660 we will get replicated storage. 47 00:02:47,660 --> 00:02:53,430 Wait for child info message lvl right. 48 00:02:53,510 --> 00:02:56,060 I think I might call that label template. 49 00:02:57,980 --> 00:02:59,420 That's even better. 50 00:02:59,420 --> 00:03:05,300 That is going to be the template that I to create these messages or these these guys with. 51 00:03:05,300 --> 00:03:07,640 So I'm going to go down where we print. 52 00:03:08,860 --> 00:03:10,670 We're not going to print anymore. 53 00:03:10,690 --> 00:03:14,470 We are going to create a label. 54 00:03:14,470 --> 00:03:21,880 So local label equals label template clown. 55 00:03:24,490 --> 00:03:29,350 Let's make the parent of the label the same as the Scripps parent. 56 00:03:29,350 --> 00:03:34,930 So LBL parent will equal the Scripps parent. 57 00:03:34,930 --> 00:03:36,820 So we're going to put it on the screen Gooey. 58 00:03:37,600 --> 00:03:37,840 All right. 59 00:03:37,840 --> 00:03:38,630 What else do we need? 60 00:03:38,650 --> 00:03:40,390 We need to change the text. 61 00:03:40,420 --> 00:03:43,000 LBL text equals. 62 00:03:43,000 --> 00:03:48,520 And we've got our message cue right, message Q one. 63 00:03:48,520 --> 00:03:51,280 And we want to make sure we do that before we remove it. 64 00:03:51,820 --> 00:03:54,560 Now, I want it to slide. 65 00:03:54,580 --> 00:03:59,740 I want it to be displayed and then go up off the screen. 66 00:03:59,740 --> 00:04:02,080 So how are we going to do that? 67 00:04:02,170 --> 00:04:03,880 This is just going to show it. 68 00:04:04,510 --> 00:04:09,880 I'm going to go to the top of my script and I get a couple more variables. 69 00:04:09,880 --> 00:04:13,330 I'm going to get one for the tween service. 70 00:04:13,330 --> 00:04:13,630 Right? 71 00:04:13,630 --> 00:04:25,630 So tween tween service does animation's we'll do game get service, tween service and what else they 72 00:04:25,630 --> 00:04:26,740 need tween info. 73 00:04:26,740 --> 00:04:28,630 And we did this for the coin stuff. 74 00:04:28,840 --> 00:04:32,680 I'm going to fill this one out a little more just for the sake of education. 75 00:04:32,680 --> 00:04:34,720 So we're going to do our tween info. 76 00:04:34,720 --> 00:04:37,750 No, the first value is the time. 77 00:04:37,750 --> 00:04:39,280 I'll say one second. 78 00:04:39,400 --> 00:04:42,700 The second value is the easing style. 79 00:04:42,700 --> 00:04:44,440 How do you want it to move? 80 00:04:44,440 --> 00:04:50,410 And we're going to do a quadratic, we're going to start slow and then it's going to speed up as it 81 00:04:50,410 --> 00:04:51,910 gets farther up the screen. 82 00:04:51,910 --> 00:05:03,010 So we're going to do e m easing style dot quad, and whether it starts fast or it ends fast is going 83 00:05:03,010 --> 00:05:08,080 to be determined by the easing direction, Right? 84 00:05:08,080 --> 00:05:13,420 So out is where it's going to be faster on the exit. 85 00:05:14,500 --> 00:05:16,510 And then we have this. 86 00:05:16,510 --> 00:05:20,080 Here is repeat count. 87 00:05:20,470 --> 00:05:23,160 So repeat counts going to be going to be zero. 88 00:05:23,170 --> 00:05:24,490 We're not going to repeat it. 89 00:05:24,820 --> 00:05:26,030 What else do we need? 90 00:05:26,050 --> 00:05:27,320 Reverses? 91 00:05:27,340 --> 00:05:28,150 Nope. 92 00:05:28,150 --> 00:05:29,710 We'll make that false. 93 00:05:30,340 --> 00:05:31,870 What else should we do? 94 00:05:31,990 --> 00:05:33,430 The delay time. 95 00:05:33,430 --> 00:05:35,010 We need time to read it. 96 00:05:35,020 --> 00:05:38,510 Let's give it a two second delay before we start moving it. 97 00:05:38,530 --> 00:05:40,500 I'm going to put this on the next line. 98 00:05:40,810 --> 00:05:43,540 Have two lines here so you could see everything. 99 00:05:43,540 --> 00:05:43,900 Right? 100 00:05:43,900 --> 00:05:51,130 So we have this is how this is how long the tween lasts, how it'll move, which direction you could 101 00:05:51,130 --> 00:05:54,250 have like a bounce or whatever, but the speed is going to be at the end. 102 00:05:54,250 --> 00:05:56,020 And then you could read those. 103 00:05:56,170 --> 00:05:58,000 You have the, the annoying pop ups. 104 00:05:58,000 --> 00:05:59,470 They're pretty helpful at START. 105 00:05:59,470 --> 00:06:02,950 But then after you've been coding for about two years, you're going to get annoying. 106 00:06:03,370 --> 00:06:03,640 All right. 107 00:06:03,640 --> 00:06:04,780 So we got that. 108 00:06:05,260 --> 00:06:06,040 What else do we need? 109 00:06:06,040 --> 00:06:08,080 Oh, the goal, right. 110 00:06:08,080 --> 00:06:11,740 I'm going to define the goal of the tween here. 111 00:06:11,740 --> 00:06:18,940 That is the stop position when the tween is finish where we're moving to and how we're doing, how we're 112 00:06:18,940 --> 00:06:20,220 doing the animation. 113 00:06:20,230 --> 00:06:22,270 We're going to animate on position. 114 00:06:22,450 --> 00:06:30,880 So we want the positions goal to be equal to a universal dimension to dot new. 115 00:06:30,880 --> 00:06:37,270 And this is going to have the x scale x pixel, y scale, y pixel. 116 00:06:37,300 --> 00:06:39,760 Let's say 0.5 X scale. 117 00:06:39,760 --> 00:06:49,270 So halfway in the screen, zero pixel offset on the x negative point five on the Y for the scale, zero 118 00:06:49,270 --> 00:06:50,470 pixel offset. 119 00:06:50,470 --> 00:06:55,750 So the -0.5 is up above the screen where you can't see. 120 00:06:55,780 --> 00:07:00,400 We're going to have it slide right up just like the coin, but we're going to have a little fancier 121 00:07:00,400 --> 00:07:01,900 easing stuff, right? 122 00:07:02,410 --> 00:07:02,640 All right. 123 00:07:02,650 --> 00:07:04,830 So we got that stuff taken care of. 124 00:07:04,840 --> 00:07:09,760 Now we go down here after we display our text. 125 00:07:10,360 --> 00:07:14,560 Let's go ahead and make a variable for the tween T. 126 00:07:14,560 --> 00:07:16,780 Yes, create. 127 00:07:17,650 --> 00:07:24,310 And we've got our label, we have our tween info and we have our goal. 128 00:07:25,260 --> 00:07:25,870 Cool. 129 00:07:25,890 --> 00:07:30,240 Now we need to play the tween tween play. 130 00:07:30,630 --> 00:07:33,720 And then I forgot the equals. 131 00:07:33,720 --> 00:07:34,710 I do that a lot. 132 00:07:35,080 --> 00:07:36,540 Get the equals right there. 133 00:07:37,800 --> 00:07:42,300 And now let's go ahead and do the tween, not tween info. 134 00:07:42,750 --> 00:07:43,710 Tween. 135 00:07:43,710 --> 00:07:44,580 Wait. 136 00:07:44,580 --> 00:07:46,740 Or what is it on? 137 00:07:46,920 --> 00:07:47,280 That's it. 138 00:07:47,280 --> 00:07:48,210 Completed. 139 00:07:48,210 --> 00:07:49,170 That's the event. 140 00:07:49,170 --> 00:07:52,350 So that's going to fire when it's done and we're going to wait here. 141 00:07:53,610 --> 00:07:56,070 That's going to induce a delay here. 142 00:07:56,260 --> 00:07:56,550 Right. 143 00:07:56,610 --> 00:07:58,020 It's going to be about 3 seconds. 144 00:07:58,020 --> 00:07:58,200 Right. 145 00:07:58,200 --> 00:08:05,010 We got one second for the tween itself, but we have a two second delay so that when the thing pops 146 00:08:05,010 --> 00:08:06,420 up, it's going to be there. 147 00:08:06,420 --> 00:08:08,400 So that's about a three second delay. 148 00:08:08,400 --> 00:08:09,450 That's not bad. 149 00:08:09,450 --> 00:08:17,010 At the end of all that, let's get our LBL and destroy it so we don't clutter up our client stuff. 150 00:08:18,000 --> 00:08:20,250 I think I'm going to get rid of this weight. 151 00:08:21,640 --> 00:08:24,790 Let's do a control X to cut it. 152 00:08:25,600 --> 00:08:31,570 I'll put a true here and then make sure you paste that weight down here. 153 00:08:31,830 --> 00:08:32,230 Right. 154 00:08:32,230 --> 00:08:34,330 So this is going to take 3 seconds. 155 00:08:34,330 --> 00:08:38,140 If there's nothing in the queue, we're going to pull every one second. 156 00:08:38,910 --> 00:08:40,110 Let's try it out. 157 00:08:44,830 --> 00:08:45,700 Here we go. 158 00:08:46,090 --> 00:08:48,660 And I should have had my output. 159 00:08:48,670 --> 00:08:49,120 There it is. 160 00:08:49,120 --> 00:08:50,110 Message one. 161 00:08:51,060 --> 00:08:52,530 Message to. 162 00:08:54,180 --> 00:08:55,680 Message three. 163 00:08:56,010 --> 00:08:58,080 That's pretty cool now. 164 00:08:58,230 --> 00:09:02,970 The Q itself, once the messages get in the queue, the order is guaranteed. 165 00:09:02,970 --> 00:09:04,570 It's going to be first in, first out. 166 00:09:04,590 --> 00:09:09,790 However, how it gets from the server to the queue is not guaranteed. 167 00:09:09,810 --> 00:09:12,900 The way we've been doing it, it hasn't been a problem. 168 00:09:12,900 --> 00:09:17,100 The first one that gets created is the first one that gets to the queue. 169 00:09:17,100 --> 00:09:23,430 But these are asynchronous calls, these remote events or asynchronous calls and things could slow them 170 00:09:23,430 --> 00:09:23,820 down. 171 00:09:23,820 --> 00:09:28,320 There could be a mismatch in ordering, especially in a regular game where there's a lot going on. 172 00:09:28,320 --> 00:09:30,480 But I think this is good enough. 173 00:09:30,660 --> 00:09:36,030 They have to fire very close to the same time in order to get a confused order. 174 00:09:36,300 --> 00:09:41,160 Now let's go ahead and move this to our zombie game. 175 00:09:42,120 --> 00:09:46,160 So I'm going to need this process, Mzgee. 176 00:09:46,380 --> 00:09:48,780 I'm going to need my info. 177 00:09:48,810 --> 00:09:49,430 Ms.. 178 00:09:49,440 --> 00:09:49,900 G. 179 00:09:49,920 --> 00:09:50,820 Label. 180 00:09:50,820 --> 00:09:53,020 And then I'm going to need the remote event. 181 00:09:53,040 --> 00:09:55,890 I'm not really going to need this server stuff. 182 00:09:55,890 --> 00:10:00,450 Where do my server script service, but maybe we'll grab it just in case. 183 00:10:00,610 --> 00:10:07,500 All right, so then I'm going to right click, I'm going to group as model and it puts it in the workspace. 184 00:10:07,620 --> 00:10:09,270 Let me call this message. 185 00:10:09,270 --> 00:10:10,110 Q 186 00:10:12,600 --> 00:10:16,020 And you should probably put a read me file in here. 187 00:10:16,320 --> 00:10:18,990 I'll go ahead and put a read me file and a pause the video. 188 00:10:19,020 --> 00:10:20,850 Then I'll show you what it says. 189 00:10:22,710 --> 00:10:28,130 I created a regular script right here in the message queue model. 190 00:10:28,140 --> 00:10:33,360 I called it read me, I disabled it, so I unchecked enabled. 191 00:10:33,360 --> 00:10:36,560 And then I just put comments here. 192 00:10:36,570 --> 00:10:44,130 Basically I said the message message gen generates test messages on the server side process message 193 00:10:44,130 --> 00:10:51,810 script place on screen guy catches and processes messages from the server via the remote event and I 194 00:10:51,810 --> 00:10:56,610 put the name of the remote event, put the remote event here, told you where to put it, replicated 195 00:10:56,610 --> 00:11:02,930 storage, put the label, told you where to put it, replicated storage. 196 00:11:02,940 --> 00:11:03,690 There we go. 197 00:11:03,870 --> 00:11:05,700 All right, so now we got this. 198 00:11:05,700 --> 00:11:11,310 Let's right click and we're going to save two roadblocks. 199 00:11:13,370 --> 00:11:16,730 Message queue, I think all distributed to the workplace. 200 00:11:16,730 --> 00:11:18,920 I got seven more shares right that way. 201 00:11:18,920 --> 00:11:21,350 You guys can grab it if you need it. 202 00:11:21,350 --> 00:11:24,560 Just look under Symantec, Nitro one for Creations. 203 00:11:24,560 --> 00:11:25,370 All right. 204 00:11:25,370 --> 00:11:26,300 We'll submit this. 205 00:11:26,300 --> 00:11:28,400 It'll be in our toolbox.